﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Domain.Entity;
using IntelligentAgriculture.WebAPI.Application.Command.LambweaninginfoCommand;
using IntelligentAgriculture.WebAPI.Application.Command.SheepfilemodelCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.LambweaninginfoCommandHandler
{
	/// <summary>
	/// 反填羔羊断奶
	/// </summary>
	/// <returns></returns>
	public class DteilLambweaninginfoCommandHandler : IRequestHandler<DteilLambweaninginfoCommand, Results<Lambweaninginfo>>
	{

		/// <summary>
		/// 接口
		/// </summary>
		private readonly ILambweaninginfoService _lambweaninginfoService;
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="lambweaninginfoService"></param>

		public DteilLambweaninginfoCommandHandler(ILambweaninginfoService lambweaninginfoService)
		{
			_lambweaninginfoService = lambweaninginfoService;
		}
		/// <summary>
		/// 反填羔羊断奶
		/// </summary>
		/// <returns></returns>
		public async Task<Results<Lambweaninginfo>> Handle(DteilLambweaninginfoCommand request, CancellationToken cancellationToken)
		{
			var result = await _lambweaninginfoService.DteilLambweaninginfo(request.eartag);
			return Results<Lambweaninginfo>.DataResult(result);
		}
	}
}
